jQuery.noConflict();
jQuery(document).ready(function(){
	jQuery("#network").on("change", function(){
		var page = 1;
		getLinksList(page);		
	});
	
	jQuery("#next-page").live("click", function(){
		
		if(typeof interval !== "undefined" && interval)
		{
			window.clearInterval(interval);
		}
		var page = jQuery("input[name=page]").val();
		if(typeof played !== "undefined" && played && played>=15)
		{
			page = parseInt(page);
		}
		else{
			page = parseInt(page) + 1;
		}
		
		getLinksList(page);
		return false;
	});
	
		jQuery("#prev-page").live("click", function(){
		if(typeof interval !== "undefined" && interval)
		{
			window.clearInterval(interval);
		}
		var page = jQuery("input[name=page]").val();
		page = parseInt(page) - 1;
		getLinksList(page);
	});
	
	jQuery(".del-link").live("click", function(){
		var uri = jQuery(this).parent("a").attr("rel");
		var areYouSure = jQuery("input[name=are_you_sure]").val();
		jQuery.msgbox(areYouSure, {
		  type: "confirm",
		  buttons : [
		    {type: "submit", value: "Yes"},
		    {type: "submit", value: "No"},
		  ]
		}, function(result) {
		  if(result == 'No'){
			  return false;
		  } else {
			  location.href=uri;
		  }
		});
	});	
	
	
	jQuery(".del-account").live("click", function(){
		var uri = jQuery(this).parent("a").attr("rel");
		var areYouSure = jQuery("input[name=are_you_sure]").val();
		jQuery.msgbox(areYouSure, {
		  type: "confirm",
		  buttons : [
		    {type: "submit", value: "Yes"},
		    {type: "submit", value: "No"},
		  ]
		}, function(result) {
		  if(result == 'No'){
			  return false;
		  } else {
			  location.href=uri;
		  }
		});
	});	
	
	jQuery(".pause-link, .play-link").live("click", function(){
		var uri = jQuery(this).parent("a").attr("rel");
		location.href=uri;
	});
	
	// select element styling
	changeSelectStyle();
	
	// user points counter
	/*pointsCount();
	var int=self.setInterval("pointsCount()", 15000);*/
	
	jQuery(".tip-tip").tipTip({
		defaultPosition: "top"
	});
});